package com.wiscamp.ninechapters.challenges.infrastructure.mappers;

import com.wiscamp.ninechapters.challenges.infrastructure.po.MedalPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface MedalMapper extends JpaRepository<MedalPO, Long>, JpaSpecificationExecutor<MedalPO> {

    @Query(value = "select e from MedalPO e where e.medalCode = :medalCode and e.deleted = false")
    MedalPO findByMedalCode(String medalCode);
}